Getting started topic

Getting started

Installation

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  flutter_easy_dialogs: <latest_version>

You can optionally connect pre-built EasyDialogManager implementations from separate packages:

dependencies:
  full_screen_dialog_manager: <latest_version>
  positioned_dialog_manager: <latest_version>

In your library add the following import:

import 'package:flutter_easy_dialogs/flutter_easy_dialogs.dart';
import 'package:full_screen_dialog_manager/full_screen_dialog_manager.dart';
import 'package:positioned_dialog_manager/positioned_dialog_manager.dart';

Setup and usage

Wrap your MaterialApp with FlutterEasyDialogs.builder() and register desired Managers.

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: FlutterEasyDialogs.builder(
        /// register managers
        setupManagers: (overlayController, managerRegistry) {
          managerRegistry
            ..registerFullScreen(overlayController)
            ..registerPositioned(overlayController);
        },
      ),
    );
  }
}

You're done. Now you are able to call show methods from IEasyDialogManagerProvider like so:

FlutterEasyDialogs.provider.showPositioned(
  const PositionedShowParams(
    content: Text('dialog'),
  )
);

Or

FlutterEasyDialogs.provider.showFullScreen(
  const FullScreenShowParams(
    content: Text('dialog'),
  ),
);

Classes

BasicDialogInsertStrategy Getting started Dialog manager Custom
Simple insert dialog strategy.
BasicDialogInsertStrategy Getting started Dialog manager Custom
Simple insert dialog strategy.
BasicDialogRemoveStrategy Getting started Dialog manager Custom
Simple implementation of remove strategy.
BasicDialogRemoveStrategy Getting started Dialog manager Custom
Simple implementation of remove strategy.
EasyDialogManager<S extends EasyDialogManagerShowParams?, H extends EasyDialogManagerHideParams?> Getting started Dialog manager Custom
This is the base class for all dialog managers.
EasyDialogManager<S extends EasyDialogManagerShowParams?, H extends EasyDialogManagerHideParams?> Getting started Dialog manager Custom
This is the base class for all dialog managers.
EasyDialogManagerHideParams Getting started Dialog manager Custom
Base class of hide params for dialog managers.
EasyDialogManagerHideParams Getting started Dialog manager Custom
Base class of hide params for dialog managers.
EasyDialogManagerShowParams Getting started Dialog manager Custom
Base data class of show params for dialog managers.
EasyDialogManagerShowParams Getting started Dialog manager Custom
Base data class of show params for dialog managers.